package com.urbainski.componentes.utils
{
	/**
	 * @author Cristian Elder Urbainski
	 * @sinse 29/12/2011
	 */
	
	public class StringUtils
	{
		public static function StringReplaceAll( source:String, find:String, replacement:String ) : String
		{
			return source.split( find ).join( replacement );
		}

		
		/* Retorna o texto como negrito e sublinhado */
		public static function highlightMatch( string:String, searchStr:String ):String
		{
			var searchStrPattern:String = "(" + searchStr + ")";
			var regExp:RegExp = new RegExp( searchStrPattern, "igm" );
			var returnStr:String = string.replace( regExp, "<b><u>$1</u></b>" );
			
			return returnStr;
		}		
	}
}